<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="libman.css">
<TITLE>
Set Variables
</TITLE>
</HEAD>
<BODY >
<A HREF="libman026.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman025.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman028.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc56">5.2</A>&nbsp;&nbsp;Set Variables</H2><UL>
<LI><A HREF="libman027.html#toc31">Declaring</A>
<LI><A HREF="libman027.html#toc32">Printing</A>
<LI><A HREF="libman027.html#toc33">Domain Access</A>
</UL>


<A NAME="toc31"></A>
<H3 CLASS="subsection"><A NAME="htoc57">5.2.1</A>&nbsp;&nbsp;Declaring</H3>
Set variables are variables which can eventually take a ground integer
set as their value. They are characterized by a lower bound (the set
of elements that are definitely in the set) and an upper bound (the
set of elements that may be in the set). A set variable can be
declared as follows: 
<PRE CLASS="verbatim">
        SetVar :: []..[1,2,3,4,5,6,7]
</PRE>If the lower bound is the empty set (like in this case) this can be written as 
<PRE CLASS="verbatim">
        SetVar subset [1,2,3,4,5,6,7]
</PRE>If the lower bound is the empty set and the upper bound is a set of
consecutive integers, one can also declare it like
<PRE CLASS="verbatim">
        intset(SetVar, 1, 7)
</PRE>which is equivalent to the above. <BR>
<BR>
The predicates to declare sets are:
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<A HREF="../bips/lib/fd_sets/NN-2.html"><B>?Set :: ++Lwb..++Upb</B></A><A NAME="@default158"></A><DD CLASS="dd-description">
 Set is an integer set within the given bounds 
<DT CLASS="dt-description"><A HREF="../bips/lib/fd_sets/intset-3.html"><B>intset(?Set, +Min, +Max)</B></A><A NAME="@default159"></A><DD CLASS="dd-description">
 Set is a set containing numbers between Min and Max 
<DT CLASS="dt-description"><A HREF="../bips/lib/fd_sets/intsets-4.html"><B>intsets(?Sets, ?N, +Min, +Max)</B></A><A NAME="@default160"></A><DD CLASS="dd-description">
 Sets is a list of N sets containing numbers between Min and Max 
</DL>
<A NAME="toc32"></A>
<H3 CLASS="subsection"><A NAME="htoc58">5.2.2</A>&nbsp;&nbsp;Printing</H3>
Set variables are by default printed in a particular way, e.g.
<PRE CLASS="verbatim">
?- X :: [2,3]..[1,2,3,4], write(X).
X{[2, 3] \/ ([] .. [1, 4]) : _308{[2 .. 4]}}
</PRE>The curly brackets contain
<OL CLASS="enumerate" type=1><LI CLASS="li-enumerate">
the lower bound of the set
<LI CLASS="li-enumerate">the union symbol
<LI CLASS="li-enumerate">the set of optional values (that may or may not be in the set)
<LI CLASS="li-enumerate">a colon
<LI CLASS="li-enumerate">a finite domain indicating the admissible cardinality for the set
</OL>
<A NAME="toc33"></A>
<H3 CLASS="subsection"><A NAME="htoc59">5.2.3</A>&nbsp;&nbsp;Domain Access</H3>
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<A HREF="../bips/lib/fd_sets/potential_members-2.html"><B>potential_members(?Set, -List)</B></A><A NAME="@default161"></A><DD CLASS="dd-description">
 List is the list of elements of whose membership in Set is currently uncertain 
<DT CLASS="dt-description"><A HREF="../bips/lib/fd_sets/set_range-3.html"><B>set_range(?Set, -Lwb, -Upb)</B></A><A NAME="@default162"></A><DD CLASS="dd-description">
 Lwb and Upb are the current lower and upper bounds on Set 
</DL>
<HR>
<A HREF="libman026.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="libman025.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="libman028.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
